{include file="Public:header" /}
<link rel="stylesheet" href="__PUBLIC__/Admin/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" media="screen"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>增加题目</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form enctype="multipart/form-data" action="__URL__/addQuestion" method="post" id="defaultForm" class="form-horizontal">

                       <!-- <div class="form-group">
                            <label class="col-sm-2 control-label">题目</label>
                            <div class="col-sm-6" style="width: 80%;">
                                <input type="text" name="title" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>-->


                        <div class="form-group">
                            <label class="col-sm-2 control-label">题目</label>
                            <div class="col-sm-6">
                                <textarea name="title" class="col-sm-6 form-control" rows="5"></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">选项A</label>
                            <div class="col-sm-6">
                                <input type="text" name="option_a" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">选项B</label>
                            <div class="col-sm-6">
                                <input type="text" name="option_b" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">选项C</label>
                            <div class="col-sm-6">
                                <input type="text" name="option_c" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">选项D</label>
                            <div class="col-sm-6">
                                <input type="text" name="option_d" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group" >
                            <label class="col-sm-2 control-label">正确答案</label>
                            <div class="col-sm-6" style="width: 100px;">
                                <input type="text" name="exactness" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <button class="btn btn-white" type="submit">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
{include file="Public:footer" /}

<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>


<script>
    $(document).ready(function() {
        /**
         * 下面是进行插件初始化
         * 你只需传入相应的键值对
         * */
        $('#defaultForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {/*输入框不同状态，显示图片的样式*/
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {/*验证*/
                title: {/*键名username和input name值对应*/
                    message: '题目验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '题目不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 10,
                            max: 200,
                            message: '题目长度必须在10到200之间'
                        }/*最后一个没有逗号*/
                    }
                },
                option_a: {/*键名username和input name值对应*/
                    message: '选项A失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '选项A不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 100,
                            message: '选项必须在1到100之间'
                        }/*最后一个没有逗号*/
                    }
                },
                option_b: {/*键名username和input name值对应*/
                    message: '题目验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '选项B不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 100,
                            message: '选项必须在1到100之间'
                        }/*最后一个没有逗号*/
                    }
                },
                option_c: {/*键名username和input name值对应*/
                    message: '题目验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '选项C不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 100,
                            message: '选项必须在1到100之间'
                        }/*最后一个没有逗号*/
                    }
                },
                option_d: {/*键名username和input name值对应*/
                    message: '题目验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '选项D不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 100,
                            message: '选项必须在1到100之间'
                        }/*最后一个没有逗号*/
                    }
                },
                exactness: {/*键名username和input name值对应*/
                    message: '正确答案验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '正确答案不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 1,
                            message: '正确答案长度最长为1'
                        }/*最后一个没有逗号*/
                    }
                },
            }
        });
    });

</script>
</body>
</html>
